package linter.utils;

import io.swagger.annotations.ApiOperation;

import java.util.Random;
import java.util.UUID;

import static linter.custom.CustomResultType.MODEL_TYPE_NOT_EXIST;

/**
 * @author 北煜
 */
public class ModelUtils {

    /**
     * 通过数字的不同获得不同的模型名称
     */
    public static String getModelNameByNumber(int number){
        switch (number){
            case 1:
                return "Linear";
            case 2:
                return "LogisticRegression";
            default:
                return MODEL_TYPE_NOT_EXIST;
        }
    }

    @ApiOperation("生成随机字符串")
    public static String generateUUID() { return UUID.randomUUID().toString(); }

    @ApiOperation("生成笔记唯一标识")
    public static int noteUniqueMark(Long uuid) {
        long currentTimeMills = System.currentTimeMillis();
        Random random = new Random(currentTimeMills + uuid);
        return random.nextInt();
    }
}
